import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.12

Page {
    id: page
    width: 600
    height: 400

    title: qsTr("Home")

    RowLayout {
        id: columnLayout
        anchors.fill: parent
        anchors.margins: 20
        GridView {
            id: gridView
            Layout.alignment: Qt.AlignLeading
            Layout.preferredWidth: 300
            Layout.preferredHeight: parent.height
            model: app.ftGridModel          /* 使用接口类下的模型 */
            delegate: Rectangle {
                width: 80
                height: 30
                border.color: 'darkgray'
                scale: mouse1.pressed ? 0.9 : 1
                Text {
                    text: model.RandValue   /* 使用接口类下的模型的数据 */
                    anchors.fill: parent
                    font.pixelSize: 18
                    verticalAlignment: Text.AlignVCenter
                    horizontalAlignment: Text.AlignHCenter

                }
                MouseArea {
                    id: mouse1
                    anchors.fill: parent
                }
            }
        }

        ListView {
            id: listView
            Layout.alignment: Qt.AlignJustify
            Layout.preferredWidth: 300
            Layout.preferredHeight: parent.height
            model: app.ftListModel          /* 使用接口类下的模型 */
            spacing: 10
            delegate: Rectangle {
                id: rect
                width: 200
                height: 30
                color: model.BodyColor      /* 使用接口类下的模型的数据 */
                scale: mouse2.pressed ? 0.9 : 1
                MouseArea {
                    id: mouse2
                    anchors.fill: parent
                }
            }
        }
    }
}
